Bases: ProgramOperationalMetric
Top-level program invocations; use to normalize other counters per call.
One increment per call to program(...), regardless of how many LM
or EM calls the program makes internally.
Example:
program.compile(
metrics=[
synalinks.metrics.ProgramCalls(),
],
)
Source code in synalinks/src/metrics/program_metrics.py
| @synalinks_export("synalinks.metrics.ProgramCalls")
class ProgramCalls(ProgramOperationalMetric):
"""Top-level program invocations; use to normalize other counters per call.
One increment per call to `program(...)`, regardless of how many LM
or EM calls the program makes internally.
Example:
```python
program.compile(
metrics=[
synalinks.metrics.ProgramCalls(),
],
)
```
"""
def __init__(self, name="program_calls", description=None):
super().__init__(name=name, description=description)
def result(self):
return int(self._delta_program("invocations"))
|